package com.app.mp3player.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.app.mp3player.R;

public class LRCListAdapter extends BaseAdapter {
	private List<String> lrcList;
	private LayoutInflater inflater;
	
	public LRCListAdapter(Context context,List<String> data) {
		inflater = LayoutInflater.from(context);
		lrcList = data;
	}

	@Override
	public int getCount() {
		return lrcList.size();
	}

	@Override
	public Object getItem(int position) {
		return lrcList.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View view, ViewGroup group) {
		if(view == null){
			view = inflater.inflate(R.layout.lrc_list_item, null);
		}
		String lrcLine = lrcList.get(position);
		TextView textView = (TextView)view.findViewById(R.id.lrc_text);
		textView.setText(lrcLine);
		System.out.println("getView------------->"+lrcLine);
		return view;
	}
}
